<cfparam name="author" type="string" default="">
<cfparam name="datasource" type="string" default="">
<cfparam name="appCFC" type="boolean" default="false">
<cfparam name="table" type="string" default="">
<cfif isdefined('session.generateType')>
	<cfset generateType = session.generateType />
</cfif>
<div id="container">
	<div id="content">
		<cfset codeGenerator = CreateObject("component", "cfcs.services.codeGenerator").init() />
		<cfset tableColumns = codeGenerator.getColumns(table) />

			   	<table border="0" width="100%" cellpadding="0" cellspacing="0">
			   		<caption>
						<h2><cfoutput>#ucase(table)# Table Structure</cfoutput></h2>
					</caption>
					<thead
		               <tr>
		                   <th>Column Name</td>
		                   <th>Data Type</td>
		                   <th>Column Size</td>
		                   <th>Is Nullable</td>
		               </tr>
              		</thead>
	               <tbody>
				       	<cfoutput query="tableColumns">
			               <tr>
			                   <td>#column_name#</td>
			                   <td>#type_name#</td>
			                   <td>#column_size#</td>
			                   <td>#is_nullable#</td>
			               </tr>
				           </cfoutput>
			        </tbody>
			       </table>
				   <cfset properties = codeGenerator.generateProperties(table)>
					<cfset properties =  replaceList(properties,"<%,%,/@","&lt;,##,%") />
					<cfoutput>
						<textarea style="font-size: 8pt; width: 100%;" wrap="hard" rows="33" name="linkNode">#properties#</textarea>
					</cfoutput>
					<!---<cfloop list="#table#" index="i">
					<cfdbinfo type="foreignkeys" datasource="#session.dsn#" name="fk" table="#i#">
					<cfdbinfo type="columns" datasource="#session.dsn#" name="remarks" table="#i#">
					<cfdump var="#fk#" label="foreign keys for #table#">
					<cfdump var="#remarks#" label="column information for #table#">
					</cfloop>--->
</div>
